tle: “Stephanie’s Housing Request”
tput:
html_document:
theme: cerulean
code_folding: hide
toc: true
toc_float: true

Week 2 Analysis

library(mosaic)
library(tidyverse)
library(pander)
library(DT) # If you get an error stating: 
            # Error in library(DT): there is no package called 'DT'
            # You will need to run: install.packages("DT") 
            # in your Console, then try "Knit HTML" again.
library(plotly)
Rent <- read_csv("../Data/Rent.csv")


Background

Stephanie1 is a student that will be starting school at BYU-Idaho next semester. Suppose she sent you the following email.


“Hi. My name is Stephanie. I would like to learn about what housing options I have for living at BYU-Idaho next semester. It will be my first semester there, so I would like to find something that is close to campus and around $300 a month in rent. I’m not too picky on roommates, but I would like somewhere that has a lot of people around so I can get to know as many people as possible. Thanks in advance!”


Write your response to Stephanie below. Use the “Rent” dataset, good statistical analysis, and clear writing to make some well supported suggestions to her about apartments that meet her stated criteria. You are free to use other criterion that you think she might find more meaningful as well.

Response

Dear Stephanie,

Thanks for reaching out! Your budget of around $300 per month for housing sums up to $1050 per semester. It’s great that you also want to live close to campus and be around more people. I did an analysis of all approved women housing in Rexburg to see what options you have.

Here’s a scatterplot that shows the relationship between distance to the Manwaring Center and the semester rent. Please note that the size and color of the dots represent the number of residents in that apartment complex, meaning, the larger and lighter the dot is, the more residents they have.

Based on this chart, it looks like Royal Crest is your best option. Their rent per semester is $995, which fits your budget. It is also only $427 crow fly meters away to the MC. On top of that, thy have the largest number of residents in this price range.

rent_subset2 = subset(Rent, Rent$Gender == 'F')

rentplotly <- ggplot(data = rent_subset2, mapping = aes(x = CrowFlyMetersToMC, y = AvgFloorPlanCost, size = Residents, color = Residents, label = Name)) +
  geom_point() +
  theme_minimal()+
  labs(title = "Approved Women's Housing in Rexburg (Cost, Distance, & Population)", x = "Distance to MC", y = "Semester Rent")

ggplotly(rentplotly)

Let’s compare Royal Crest to the rest of approved women’s housing by looking at their statistics below:

The average cost of approved women’s housing in Rexburg is $1340, with an average distance of 618 and an average population of 151 tenants. As you can see, Royal Crest is cheaper by $345 per semester, closer by 191 meters, and have 151 more tenants than the average.

rent_subset = subset(Rent, Rent$Gender == 'F')

cat("Summary of Semester Rent:\n")
## Summary of Semester Rent:
print(summary(rent_subset$AvgFloorPlanCost))
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     880    1200    1351    1340    1593    1790
cat("\nSummary of Distance to MC:\n")
## 
## Summary of Distance to MC:
print(summary(rent_subset$CrowFlyMetersToMC))
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   248.5   495.7   556.3   618.2   774.0  1041.1
cat("\nSummary of Number of Residents:\n")
## 
## Summary of Number of Residents:
print(summary(rent_subset$Residents))
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     6.0    40.5   102.0   151.8   204.0   550.0

If you are interested in other options, here’s a list of all apartments that meet your criteria:

rent_subset = subset(Rent, Rent$AvgFloorPlanCost <= 1050)

rent_subset = subset(rent_subset, rent_subset$Gender == 'F')

rent_subset = subset(rent_subset, rent_subset$CrowFlyMetersToRicks < 1000)

datatable(rent_subset[c('Name', 'AvgFloorPlanCost', 'CrowFlyMetersToMC', 'Residents')], options=list(lengthMenu = c(12,30)), extensions="Responsive")

  1. Note that Stephanie is a fictional character who is based on real experiences of many faculty and staff here at BYU-Idaho.↩︎